home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / recoqlib / demo / testreq.s < prev   
Text File  |  1980-01-03  |  1KB  |  70 lines

  1.  
  2.                 * TestReq.s demo source for recoq.library *
  3.                         * Written by Cath of LsD *
  4.                      * recoq.library by Cath of LsD *
  5.                * compiles under devpac 3.00 with system gs *
  6.  
  7.     incdir    xnclude:asm/        ; your include path
  8.  
  9.     include libraries/recoq.i
  10.     include libraries/recoq_lib.i
  11.  
  12.  
  13.     section    code,code
  14.  
  15.     lea    RecoqLibName(pc),a1
  16.     moveq    #0,d0            ; Version of library
  17.     CALLEXEC OpenLibrary        ; open library
  18.     move.l    d0,_RecoqBase        ; Store ptr to library
  19.     tst.l    d0
  20.     beq.s    NoLibrary        ; Oh come on guys sort it out
  21.  
  22.     lea    DosLibName(pc),a1
  23.     moveq    #0,d0            ; Version code
  24.     CALLEXEC OpenLibrary        ; open library
  25.     move.l    d0,_DOSBase
  26.  
  27.     move.l    d0,a6
  28.     CALLDOS Output            ; get output handle in d0
  29.  
  30.     move.l    d0,_Output        ; store it
  31.  
  32.     lea    Buffer(pc),a0        ; get ptr to buffer
  33.  
  34.     CALLRECOQ rqWhatIs        ; call function 
  35.  
  36. ; Returns ptr to string in d2
  37. ; And length in d3
  38. ; String is also zero terminated (ASCIZ) 
  39. ; so by moving d2 to d1 you can use PutStr instead
  40.  
  41.     move.l    _Output(pc),d1        ; output handle
  42.     CALLDOS    Write            ; write to default output
  43.  
  44.     move.l    _RecoqBase(pc),a1    ; close library
  45.     CALLEXEC CloseLibrary
  46.  
  47. NoLibrary
  48.     move.l    _DOSBase(pc),a1        ; close library
  49.     CALLEXEC CloseLibrary
  50.  
  51.     clr.l    d0            ; exit to dos
  52.     rts                ; with no error code
  53.  
  54. _RecoqBase
  55.     dc.l    0
  56. _DOSBase
  57.     dc.l    0
  58. _Output
  59.     dc.l    0
  60.  
  61. DosLibName
  62.     DOSNAME
  63.  
  64. RecoqLibName
  65.     RECOQNAME
  66. Buffer
  67.     incbin    sys:disk.info  ; include a crunched file here !
  68.  
  69.     END
  70.